package com.chen.hotel.converter;

import com.chen.hotel.domain.Users;
import com.chen.hotel.dto.UserDTO;
import org.springframework.beans.BeanUtils;

public class User2UserDTO {

    /**
     * 将Users类型转化为UserDTO类型
     * @param users
     * @return
     */
    public static UserDTO convert(Users users){
        UserDTO userDTO = new UserDTO();
        BeanUtils.copyProperties(users, userDTO);
        return userDTO;
    }
}
